import {useStore} from "vuex"
// 全局请求封装
const base_url = 'http://localhost:8890'
const store = new useStore();
export default async function request(options){
	const header = {
		"satoken": uni.getStorageSync("satoken"),
	} 
	return new Promise((resolve,reject)=>{
		uni.request({
			url:base_url+ options.url,
			method: options.method,
			header,
			data:options.params,
			success:(response)=>{
				console.log("接口调用成功",response);
				resolve(response.data.data)
			},
			fail:(response)=>{
				console.log("接口调用失败");
				reject(response);
			}
		})
	})  
}